# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.org> 
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: damir <damir@archlinux.org>
# Contributor: Daniel Bainton <dpb [at] backarrow.org>

pkgname=ncmpc
pkgver=0.48
pkgrel=1
pkgdesc="Fully featured MPD client which runs in a terminal"
arch=(x86_64)
url=https://www.musicpd.org/clients/ncmpc/
license=(GPL2)
depends=(
  gcc-libs
  glibc
  lirc
  pcre2
)
makedepends=(
  boost
  libmpdclient
  meson
  ncurses
  python-sphinx
)
optdepends=(
  'python-beautifulsoup4: for lyrics scripts'
  'python-requests: for lyrics scripts'
)
source=(https://www.musicpd.org/download/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz{,.sig})
sha512sums=('71739fefe696402d4a594a0c931bae0d6fc26f2b7203c51b3d6664c703276ad55f32ea247e1100224a3072386b6de067c1c2e43aa8b6cfac564f7f215ec11f7b'
            'SKIP')
b2sums=('ee25298af9d50eff646d74aa8908358a3df7b5ca7cf0666b6d3d31027e66d1219c2a48c5097e160d728db2965e2113a0915accac0d97f246d6e75152a2c9a1b3'
        'SKIP')
validpgpkeys=('0392335A78083894A4301C43236E8A58C6DB4512') # Max Kellermann <max@blarg.de>

build() {
  arch-meson -D lyrics_screen=true -D chat_screen=true build $pkgname-$pkgver
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}
package() {
  depends+=(
    libmpdclient libmpdclient.so
    ncurses libncursesw.so
  )

  meson install -C build --destdir "$pkgdir"
}
